Jquery smartSelects plugin
Use to create more intelligent dropdown select, support ajax data resource.
Load
1 | git clone https://github.com/lizus/jquery.smartSelects.git |
after download, see dist/index.html
for more detail.
Sample html code
1 | <div class="smartSelect" data-component="smartSelect" data-total="2" data-row="10"> |
Specification
data-component="smartSelect"
component identify code, if use it before us, it will auto load. else use$(this).smartSelect();
loaddata-total="2"
the max select option countdata-row="10"
only ajax use. if less then settled value(10), it will get new value from ajaxdata-field="value"
selected value. jsonp string, decode sample:1
2
3
4
5
6
7
8
9
10[
{
key: 'hello',
value: 'world'
},
{
key: 'hello',
value: 'world'
},
]data-field="source"
select option resource, format as valuedata-field="ajax"
ajax resource url,only support get method. If get values, it will settledata-field="ajax-source"
,data-ajax-source="{search keyword}"
data-field="selected"
the display element for selected value
Events
when click: selected-click
when input change: selected-change
when leave: selected-leave
when selected-click, it will set data-status="active"
to the main component to tag the activity status.
when selected-leave, it will set data-status="leave"
to the main component to tag the leave status.